home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 6503 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.2 KB

  1. Path: news.aros.net!kwalker
  2. From: kwalker@aros.net (Knight Walker)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: fclose() and remove() within a funct'n
  5. Date: 25 Feb 1996 11:54:49 GMT
  6. Organization: ArosNet Inc.
  7. Message-ID: <4gpime$8on@news.aros.net>
  8. References: <4fo8ps$3v6@milo.freenet.vancouver.bc.ca>
  9. NNTP-Posting-Host: terra.aros.net
  10. X-Newsreader: TIN [version 1.2 PL2]
  11.  
  12. Patrick Wong (zipz@opus.freenet.vancouver.bc.ca) wrote:
  13. : I'm writing a function that is supposed to close and remove temporary files
  14. : on a DOS machine.  I'm posting this in c.l.c because it's a C question as 
  15. : well as a DOS question.
  16. : I am using the atexit() function to close the temporary file before 
  17. : exiting the function.  Yet the atexit() function will not allow me to 
  18. : pass a pointer to the file that I want to close (and delete).  The 
  19. : function MUST be responsible for closing and deleting all temporary files 
  20. : it creates upon PROGRAM termination (hence the atexit() function).
  21.  
  22. Well, the problem is that atexit() registers functions that take no 
  23. arguments (e.g. quit(void)).  It doesn't allow function arguments to be 
  24. passed (Because the functions are called in an interrupt form, and you 
  25. can't control how they're called).
  26.